package com.zzb.dao.impl;

import com.zzb.dao.ProductTypeDao;
import com.zzb.entity.ProductTypeEntity;
import com.zzb.util.MyBatisUtils;

import java.util.List;

public class ProductTypeDaoImpl implements ProductTypeDao {
    @Override
    public ProductTypeEntity findByName(ProductTypeEntity productTypeEntity) {
        ProductTypeDao productTypeDao = MyBatisUtils.getMapper(ProductTypeDao.class);
        return productTypeDao.findByName(productTypeEntity);
    }

    @Override
    public int add(ProductTypeEntity productTypeEntity) {
        ProductTypeDao productTypeDao = MyBatisUtils.getMapper(ProductTypeDao.class);
        return productTypeDao.add(productTypeEntity);
    }

    @Override
    public int delete(ProductTypeEntity productTypeEntity) {
        ProductTypeDao productTypeDao = MyBatisUtils.getMapper(ProductTypeDao.class);
        return productTypeDao.delete(productTypeEntity);
    }

    @Override
    public ProductTypeEntity findById(ProductTypeEntity productTypeEntity) {
        ProductTypeDao productTypeDao = MyBatisUtils.getMapper(ProductTypeDao.class);
        return productTypeDao.findById(productTypeEntity);
    }

    @Override
    public List<ProductTypeEntity> findAll(ProductTypeEntity productTypeEntity) {
        ProductTypeDao productTypeDao = MyBatisUtils.getMapper(ProductTypeDao.class);
        return productTypeDao.findAll(productTypeEntity);
    }

    @Override
    public int update(ProductTypeEntity productTypeEntity) {
        ProductTypeDao productTypeDao = MyBatisUtils.getMapper(ProductTypeDao.class);
        return productTypeDao.update(productTypeEntity);
    }

    @Override
    public int count(ProductTypeEntity productTypeEntity) {
        ProductTypeDao productTypeDao = MyBatisUtils.getMapper(ProductTypeDao.class);
        return productTypeDao.count(productTypeEntity);
    }
}
